package com.wangliang.deepseek.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class ChatController {

    @GetMapping("/")
    public String chatPage(Model model) {
        // 这里可以添加用户信息等
        model.addAttribute("username", "user");
        return "chat";
    }

    @PostMapping("/api/chat")
    @ResponseBody
    public String handleChat(@RequestBody String message) {
        // 处理聊天消息的逻辑
        return "Response to: " + message;
    }
}